/* tcplq.c - tcplq */

#include "tcpfms.h"
#include "tcb.h"
#include "port.h"

/*------------------------------------------------------------------------
 *  tcplq - set the listen queue size for a TCP pseudo device
 *------------------------------------------------------------------------
 */
int tcplq(struct tcb *ptcb, unsigned lqsize)
{
    if (ptcb->tcb_state == TCPS_FREE)
            return SYSERR;
    ptcb->tcb_lqsize = lqsize;

    if (ptcb->tcb_type == TCPT_SERVER)
        resizeport(ptcb->tcb_listenq, lqsize);

    return OK;
}
